using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using Inventory.Database.Mapping;
using Inventory.Domain.Models;

namespace Inventory.Database
{
    public class InventoryContext : DbContext
    {
        //static InventoryContext()
        //{
        //    System.Data.Entity.Database.SetInitializer<InventoryContext>(null);
        //}

        //public InventoryContext()
        //    : base("Name=InventoryContext")
        //{
        //}

        public DbSet<Gender> Genders { get; set; }
        public DbSet<MovieCharacter> MovieCharacters { get; set; }
        public DbSet<MovieGenre> MovieGenres { get; set; }
        public DbSet<MovieMediaType> MovieMediaTypes { get; set; }
        public DbSet<MovieRating> MovieRatings { get; set; }
        public DbSet<Movie> Movies { get; set; }
        public DbSet<MoviesMovieGenre> MoviesMovieGenres { get; set; }
        public DbSet<MoviesPersonsProfession> MoviesPersonsProfessions { get; set; }
        public DbSet<Person> People { get; set; }
        public DbSet<PersonsProfession> PersonsProfessions { get; set; }
        public DbSet<Profession> Professions { get; set; }
        

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new GenderMap());
            modelBuilder.Configurations.Add(new MovieCharacterMap());
            modelBuilder.Configurations.Add(new MovieGenreMap());
            modelBuilder.Configurations.Add(new MovieMediaTypeMap());
            modelBuilder.Configurations.Add(new MovieRatingMap());
            modelBuilder.Configurations.Add(new MovieMap());
            modelBuilder.Configurations.Add(new MoviesMovieGenreMap());
            modelBuilder.Configurations.Add(new MoviesPersonsProfessionMap());
            modelBuilder.Configurations.Add(new PersonMap());
            modelBuilder.Configurations.Add(new PersonsProfessionMap());
            modelBuilder.Configurations.Add(new ProfessionMap());
            
        }
    }
}
